package com.frontalcode 
{
	import flash.events.*;
	
	/**
	 * The FrontalEvent is used to dispatch Frontal events.
	 */
    public class FrontalEvent extends Event
    {
		// DocumentElement events.
		//
		static public var CONSTRUCT					: String = "construct";
		static public var PRE_RENDER				: String = "preRender";
		static public var RENDER					: String = "render";
		static public var INITIAL_RESET				: String = "initialReset";
		static public var RESET						: String = "reset";
		static public var PREPARE_ASSETS			: String = "prepareAssets";
		static public var SELECT					: String = "select";
		static public var DESELECT					: String = "deselect";
		static public var SELECT_TRANSITION_END		: String = "selectTransitionEnd";
		static public var DESELECT_TRANSITION_END	: String = "deselectTransitionEnd";
		static public var WILL_SELECT				: String = "willSelect";
		static public var DESTROY					: String = "destroy";
		static public var LINK_CHANGE				: String = "linkChange";				// Monitored by a CSS selector constraint.
		static public var VISITED_CHANGE			: String = "visitedChange";				// Monitored by a CSS selector constraint.
		static public var ENABLED_CHANGE			: String = "enabledChange";				// Monitored by a CSS selector constraint.
		static public var SELECTED_CHANGE			: String = "selectedChange";			// Monitored by a CSS selector constraint.
		static public var PSEUDO_CLASS_STATE_CHANGE	: String = "pseudoClassStateChange";	// Monitored by a CSS selector constraint for custom pseudoclasses.
		static public var PROGRESS					: String = "progress";					// details.progress is the updated progress report for the DocumentElement.
		
		// Events to support pseudo-classes in stylesheet selectors. Some
		// pseudo-classes are well supported by the standard events that we 
		// don't create special events for them. For example, :hover simply uses
		// the MouseEvent.MOUSE_OVER and MouseEvent.MOUSE_OUT events.
		//
		static public var VISITED					: String = "visited";
		static public var LINKED					: String = "linked";
		static public var LINKED_END				: String = "linkedEnd";
		static public var DISABLED					: String = "disabled";
		static public var ENABLED					: String = "enabled";
		
		// Container events.
		//
		static public var RESIZE					: String = "resize";
		static public var REPOSITION				: String = "reposition";
		static public var ENTER_FRAME				: String = "enterFrame";
		                                        	
		// ContainerForm events.
		//
		static public var SUBMIT					: String = "submit";
		
		// AssetManager events.                 	
		//                                      	
		static public var LOADED 					: String = "loaded";
		static public var FAILED 					: String = "failed";
		
		// StylesheetSelector events.
		//
		static public var MATCH_BEGIN 				: String = "matchBegin";
		static public var MATCH_END 				: String = "matchEnd";
		static public var NOTIFICATION 				: String = "notification";		// This supports the ability to broadcast information to all DocumentElements that match a selector.
		
		// Document events.                       	
		//                                      	
		static public var INSERT_XML				: String = "insertXML";			// details.xmlSegment is the added XML.
		static public var ADD_ELEMENT				: String = "addElement";		// details.docElem is the added element.
		static public var REMOVE_ELEMENT			: String = "removeElement";		// details.docElem is the element being removed.
		
		// DeepLinkManager events.                 	
		//                                      	
		static public var INITIALIZED 				: String = "initialized";
		
		// General events.                       	
		//                                      	
		static public var CHANGE					: String = "change";
		                                        	
		// A transitioner will dispatch events during its life space. INIT is
		// sent when the transitioner has been chosen for a specific transition.
		// START is sent when it actually starts (which may be after some 
		// delay). FFORWARD, STOP AND RESUME are sent if those methods are
		// called on the transitioner. TRANSITION_DONE is called when the
		// transitioner completes.
		//
		static public var INIT								: String = "init";
		static public var START							: String = "start";
		static public var FFORWARD							: String = "fastForward";
		static public var STOP								: String = "stop";
		static public var RESUME							: String = "resume";
		static public var TRANSITION_DONE					: String = "transitionDone";

		public var details : Object;
		
		/**
		 * Creates a new FrontalEvent instance.
		 */
		public function FrontalEvent ( type : String, details : Object = null )
		{
			super ( type );
			
			this.details = details;
		}
	}
}

